package com.wyl.auth.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;

/**
 * @Description 系统用户角色表
 * @Author WuYiLong
 * @Date 2025-04-05
 */
@Data
@TableName("sys_user_role")
@Entity
@Table(name="sys_user_role")
@org.hibernate.annotations.Table(appliesTo = "sys_user_role",comment = "系统用户角色表")
public class SysUserRole extends Model<SysUserRole> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(columnDefinition = "bigint comment '主键id'")
    private Long id;

    @Column(columnDefinition = "bigint comment '用户id'")
    private Long userId;

    @Column(columnDefinition = "bigint comment '角色id'")
    private Long roleId;

    @Override
    public Serializable pkVal() {
        return this.id;
    }

}
